﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Khoanchiphi.aspx.cs" Inherits="QLHD.Khoanchiphi" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style>
        tr.header-row
        {
            font-weight: bold;
            font-size: 14px;
        }
        tr.header-row td
        {
            text-align: center;
        }
        table caption
        {
            font-weight: bold;
            font-size: 16pt;
        }
        table.report-table tr td
        {
            white-space: normal;
        }
        caption
        {
            margin: 30px;
        }
        #divColFilter tr td
        {
            text-align: center;
            font-size: 14px;
            font-weight: bold;
        }
        #MainContent_btnCustomColumn
        {
            margin-left: 20px;
        }
        table.report-table td.number
        {
            text-align: right;
        }
        .pager li span
        {
            background-color: rgba(194, 212, 219, 0.66);
        }
        #divphongban td input[type="checkbox"], #divphongban td label
        {
            float: left;
        }
        #divphongban td label
        {
            margin-left: 5px;
        }
        .tr-warning
        {
            color:Red;
        }
        .tr-hd
        {
            font-weight:bold;
        }
    </style>
    <script language="javascript" type="text/javascript">
        $().ready(function () {
            $("#MainContent_txtfromdate, #MainContent_txttodate").kendoDatePicker({
                format: "dd/MM/yyyy"
            });

            $('#divphongban td input[type="checkbox"]').click(function () {
                var slrooms = "";
                var ids = "";
                $.each($('#divphongban td input[type="checkbox"]'), function (i, item) {
                    if ($(item).attr("checked") == "checked") {
                        if (slrooms != "")
                            slrooms += ", ";
                        slrooms += $(item).parent().children("label").text();

                        if (ids != "")
                            ids += ",";
                        ids += $(item).val();
                    }
                });
                $("#MainContent_roomslabel").text(slrooms);
                $("#MainContent_selectdids").val(ids);
            });
            $("#MainContent_roomslabel").focus(function () {
                SelectDepartment();
            });
        });

        function SelectDepartment() {
            $(".k-overlay").show();
            $("#divphongban").show();
            var wndwidth = $(window).width();
            var _left = (wndwidth - $("#divphongban").width()) / 2;
            $("#divphongban").css("left", _left);
        }
        function closepopup() {
            $(".k-overlay").hide();
            $("#divphongban").hide();
        }
        function Validate() {
            var chked = $('#divphongban td input[type="checkbox"]:checked').length;
            if (chked == 0) {
                alert("Bạn chưa chọn phòng nào.");
                return false;
            }

            return true;
        }
        function CustomColumn() {
            if ($("#divColFilter").css("display") == "none") {
                $("#divColFilter").show();
                $("#MainContent_btnCustomColumn").val("Ẩn tùy chỉnh hiển thị");
            } else {
                $("#divColFilter").hide();
                $("#MainContent_btnCustomColumn").val("Tùy chỉnh hiển thị");
            }
            return false;
        }
        function AddKCP(vMaHD, parentid) {
            var url = "/KCPPopup.aspx?MaHD=" + vMaHD;
            if (parentid != "0" && parentid != null) {
                url += "&ParentID=" + parentid;
            }

            var popupwindow = $("#addkcpwindow");
            var wndwidth = $(window).width();
            popupwindow.kendoWindow({
                width: (wndwidth * 0.7) + "px",
                height: "600px",
                title: "Thêm Khoán chi phí",
                content: url,
                modal: true,
                animation: false,
                center: true
            });
            popupwindow.data("kendoWindow").open().center();
        }

        function EditKCP(makcp) {
            var vMaHD = 0;
            var url = "/KCPPopup.aspx?MaKCP=" + makcp;

            var popupwindow = $("#addkcpwindow");
            var wndwidth = $(window).width();
            popupwindow.kendoWindow({
                width: (wndwidth * 0.7) + "px",
                height: "600px",
                title: "Sửa Khoán chi phí",
                content: url,
                modal: true,
                animation: false,
                center: true
            });
            popupwindow.data("kendoWindow").open().center();
        }

        function ItemCommand(sender) {
            if (confirm('Bạn có chắc chắn muốn xóa khoán chi phí này không?')) {
                var ma = $(sender).parents("tr").attr("makcp");
                $.ajax({
                    type: "post",
                    url: "/Handlers/post.ashx/DeleteKCP",
                    //dataType: "json",
                    data: { MaKCP: ma, act: "xkcp" },
                    success: function (data) {
                        if (data == "success") {
                            window.location.reload();
                        }
                    }
                });
            } else
                return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SidebarContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="k-overlay" style="display: none; z-index: 10002; opacity: 0.5;">
    </div>
    <div id="divphongban" style="display: none; z-index: 10003; position: absolute; top: 30px;
        background-color: #fff;">
        <h3 style="margin-left: 10px;">
            Chọn phòng</h3>
        <div style="height: 500px; overflow-y: scroll; margin: 15px;">
            <asp:CheckBoxList runat="server" ID="chklphongban" RepeatDirection="Vertical" DataTextField="Ten"
                DataValueField="ID">
            </asp:CheckBoxList>
            <input type="hidden" id="selectdids" runat="server" />
        </div>
        <div style="text-align: right; margin: 10px;">
            <input type="button" value="Đóng" onclick="closepopup();" /></div>
    </div>
    <div id="addkcpwindow" style="display: none">
    </div>
    <div id="dviFilter">
        <input type="button" value="Chọn phòng" onclick="SelectDepartment();" />
        <asp:TextBox ID="txtfromdate" placeholder="Từ ngày" runat="server"></asp:TextBox>
        <asp:TextBox ID="txttodate" placeholder="Đến ngày" runat="server"></asp:TextBox>
        <asp:DropDownList ID="chktrangthai" runat="server">
            <asp:ListItem Value="all" Text="Tất cả"></asp:ListItem>
            <asp:ListItem Value="done" Text="Đã hoàn thành"></asp:ListItem>
            <asp:ListItem Value="doing" Text="Chưa hoàn thành"></asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="btnShow" OnClientClick="return Validate();" runat="server" Text="Hiển thị"
            OnClick="btnShow_Click" />
        <asp:Button ID="btnExpExcel" runat="server" Text="Excel" OnClick="btnExpExcel_Click" />
        <%--<asp:Button ID="btnShow" runat="server" Text="Hiển thị" OnClick="btnShow_Click" />--%>
        <asp:Button ID="btnCustomColumn" runat="server" OnClientClick=" return CustomColumn();"
            Text="Tùy chỉnh hiển thị" />
        <div style="float: right; margin-right: 10px; width:300px; font-size:13pt; font-weight:bold;">
            <a href="/Khoanchiphi.aspx?notify=1" runat="server" style="color:Red;" id="divNotify" title="Danh sách hợp đồng có chi phí thực hiện khác chi phí giao khoán">{0} hợp đồng có CPTH khác CPGK</a>
        </div>
        <div style="clear: both">
        </div>
        <div id="divColFilter" style="display: none;">
            <table border="1">
                <tr>
                    <td colspan="3">
                        Hợp đồng
                    </td>
                    <td colspan="3">
                        Phương khoán chi phí
                    </td>
                    <td rowspan="3">
                        Phòng chủ quản
                    </td>
                    <td rowspan="3">
                        Tiến độ thực hiện
                    </td>
                    <td colspan="11">
                        Chi tiết chi phí giao khoán
                    </td>
                    <td rowspan="3">
                        Tổng cộng chi phí giao khoán
                    </td>
                    <td colspan="11">
                        Chi tiết chi phí thực hiện
                    </td>
                    <td rowspan="3">
                        Tổng cộng chi phí thực hiện
                    </td>
                    <td colspan="3">
                        Quyết toán
                    </td>
                    <td rowspan="3">
                        Ghi chú
                    </td>
                </tr>
                <tr>
                    <td rowspan="2">
                        Số
                    </td>
                    <td rowspan="2">
                        Ngày
                    </td>
                    <td rowspan="2">
                        Giá trị
                    </td>
                    <td rowspan="2">
                        Số
                    </td>
                    <td rowspan="2">
                        Ngày
                    </td>
                    <td rowspan="2">
                        Giá trị
                    </td>
                    <td rowspan="2">
                        Thực thanh, thực chi
                    </td>
                    <td rowspan="2">
                        Chi qua công ty
                    </td>
                    <td colspan="6">
                        Thuê mua ngoài
                    </td>
                    <td rowspan="2">
                        Lương
                    </td>
                    <td rowspan="2">
                        Nguyên nhiên vật liệu, CCDC
                    </td>
                    <td rowspan="2">
                        Chi phí khác
                    </td>
                    <td rowspan="2">
                        Thực thanh, thực chi
                    </td>
                    <td rowspan="2">
                        Chi qua công ty
                    </td>
                    <td colspan="6">
                        Thuê mua ngoài
                    </td>
                    <td rowspan="2">
                        Lương
                    </td>
                    <td rowspan="2">
                        Nguyên nhiên vật liệu, CCDC
                    </td>
                    <td rowspan="2">
                        Chi phí khác
                    </td>
                    <td rowspan="2">
                        Số
                    </td>
                    <td rowspan="2">
                        Ngày
                    </td>
                    <td rowspan="2">
                        Giá trị
                    </td>
                </tr>
                <tr>
                    <td>
                        TKCM
                    </td>
                    <td>
                        Thuê chuyên gia
                    </td>
                    <td>
                        Phân tích mẫu (TN)
                    </td>
                    <td>
                        Phân tích mẫu (P.MT)
                    </td>
                    <td>
                        Hóa chất
                    </td>
                    <td>
                        Thuê mua ngoài khác
                    </td>
                    <td>
                        TKCM
                    </td>
                    <td>
                        Thuê chuyên gia
                    </td>
                    <td>
                        Phân tích mẫu (TN)
                    </td>
                    <td>
                        Phân tích mẫu (P.MT)
                    </td>
                    <td>
                        Hóa chất
                    </td>
                    <td>
                        Thuê mua ngoài khác
                    </td>
                </tr>
                <tr style="line-height: 45px;">
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chksohd" Text="" Value="tddoitac" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkngayhd" Text="" Value="tdsohd" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkgiatrihd" Text="" Value="tdngaykyhd" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chksokcp" Text="" Value="tdgiatrihd" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkngaykcp" Text="" Value="tdthoigianth" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkgiatrikcp" Text="" Value="tdghichuhd" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkphong" Text="" Value="tdngayxnkl" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chktiendothuchien" Text="" Value="tdgiatrixnkl" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgktttc" Text="" Value="tdngaythanhly" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkquacty" Text="" Value="tdgiatrithanhly" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgktkcm" Text="" Value="tdsohoadon" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkthuechuyengia" Text="" Value="tdngayhoadon" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkptmtn" Text="" Value="tdngaytutt" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkptmmt" Text="" Value="tdgiatritutt" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkhoachat" Text="" Value="tdtdth" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkthuemuangoai" Text="" Value="tdcnct" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkluong" Text="" Value="tdphong" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgknvl" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgkcpk" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctgktongcp" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthtttc" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthchiquacty" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthtkcm" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctththuechuyengia" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthptmtn" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthptmmt" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthhoachat" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctththuemuangoai" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthluong" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthnvl" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthcpk" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkctthtongcp" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chksoquyettoan" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkngayquyettoan" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkgiatriquyettoan" Text="" Value="tdtgcanhbao" />
                    </td>
                    <td style="width: 50px;">
                        <asp:CheckBox runat="server" Checked="true" ID="chkghichu" Text="" Value="tdtgcanhbao" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div style="margin: 10px 0; width: 150%;">
        <asp:Repeater ID="rptKcp" runat="server" OnItemCommand="rptKcp_ItemCommand" OnItemDataBound="rptKcp_ItemDataBound">
            <HeaderTemplate>
                <table border="1" cellpadding="2" class="report-table">
                    <caption>
                        Khoán chi phí
                    </caption>
                    <tr class="header-row" >
                        <td rowspan="3">
                            STT
                        </td>
                        <td rowspan="3" style="width: 200px; white-space: normal;">
                            <div style="width: 200px;">
                                Nội dung hợp đồng</div>
                        </td>
                        <%if (GetColspan("hopdong") > 0)
                          { %>
                        <td colspan='<%=GetColspan("hopdong") %>'>
                            Hợp đồng
                        </td>
                        <%} %>
                        <%if (GetColspan("kcp") > 0)
                          { %>
                        <td colspan='<%=GetColspan("kcp") %>'>
                            Khoán chi phí
                        </td>
                        <%} %>
                        <%if (chkphong.Checked)
                          { %>
                        <td rowspan="3" style="width: 100px; white-space: normal;">
                            Phòng chủ quản
                        </td>
                        <%} %>
                        <%if (chktiendothuchien.Checked)
                          { %>
                        <td rowspan="3" style="width: 100px; white-space: normal;">
                            Tiến độ thực hiện
                        </td>
                        <%} %>
                        <%if (GetColspan("ctcpgk") > 0)
                          { %>
                        <td colspan='<%=GetColspan("ctcpgk") %>'>
                            Chi tiết chi phí giao khoán
                        </td>
                        <%} %>
                        <%if (chkctgktongcp.Checked)
                          { %>
                        <td rowspan="3">
                            Tổng chi phí giao khoán
                        </td>
                        <%} %>
                        <%if (GetColspan("ctcpth") > 0)
                          { %>
                        <td colspan='<%=GetColspan("ctcpth") %>'>
                            Chi tiết chi phí thực hiện
                        </td>
                        <%} %>
                        <%if (chkctthtongcp.Checked)
                          { %>
                        <td rowspan="3" style="width: 80px; white-space: normal;">
                            Tổng cộng chi phí thực hiện
                        </td>
                        <%} %>
                        <%if (GetColspan("quyettoan") > 0)
                          { %>
                        <td colspan='<%=GetColspan("quyettoan") %>'>
                            Quyết toán
                        </td>
                        <%} %>
                        <%if (chkghichu.Checked)
                          { %>
                        <td rowspan="3" style="width: 100px; white-space: normal;">
                            Ghi chú
                        </td>
                        <%} %>
                        <td rowspan="3" style="white-space: normal;">
                            &nbsp;
                            <div style="width: 250px">
                            </div>
                        </td>
                        <%--<td rowspan="3">
                            &nbsp;
                        </td>--%>
                    </tr>
                    <tr class="header-row">
                        <%if (chksohd.Checked)
                          { %>
                        <td rowspan="2">
                            Số
                        </td>
                        <%} %>
                        <%if (chkngayhd.Checked)
                          { %>
                        <td rowspan="2">
                            Ngày
                        </td>
                        <%} %>
                        <%if (chkgiatrihd.Checked)
                          { %>
                        <td rowspan="2">
                            Giá trị
                        </td>
                        <%} %>
                        <%if (chksokcp.Checked)
                          { %>
                        <td rowspan="2">
                            Số
                        </td>
                        <%} %>
                        <%if (chkngaykcp.Checked)
                          { %>
                        <td rowspan="2">
                            Ngày
                        </td>
                        <%} %>
                        <%if (chkgiatrikcp.Checked)
                          { %>
                        <td rowspan="2">
                            Giá trị
                        </td>
                        <%} %>
                        <%if (chkctgktttc.Checked)
                          { %>
                        <td rowspan="2">
                            Thực thanh, thực chi
                        </td>
                        <%} %>
                        <%if (chkctgkquacty.Checked)
                          { %>
                        <td rowspan="2">
                            Chi qua công ty
                        </td>
                        <%} %>
                        <%if (GetColspan("gkthuemuangoai") > 0)
                          { %>
                        <td colspan='<%=GetColspan("gkthuemuangoai") %>'>
                            Thuê mua ngoài
                        </td>
                        <%} %>
                        <%if (chkctgkluong.Checked)
                          { %>
                        <td rowspan="2">
                            Lương
                        </td>
                        <%} %>
                        <%if (chkctgknvl.Checked)
                          { %>
                        <td rowspan="2">
                            Nguyên liệu vật liệu, CCDC
                        </td>
                        <%} %>
                        <%if (chkctgkcpk.Checked)
                          { %>
                        <td rowspan="2">
                            Chi phí khác
                        </td>
                        <%} %>
                        <%if (chkctthtttc.Checked)
                          { %>
                        <td rowspan="2">
                            Thực thanh, thực chi
                        </td>
                        <%} %>
                        <%if (chkctthchiquacty.Checked)
                          { %>
                        <td rowspan="2">
                            Chi qua công ty
                        </td>
                        <%} %>
                        <%if (GetColspan("ththuemuangoai") > 0)
                          { %>
                        <td colspan='<%=GetColspan("ththuemuangoai") %>'>
                            Thuê mua ngoài
                        </td>
                        <%} %>
                        <%if (chkctthluong.Checked)
                          { %>
                        <td rowspan="2">
                            Lương
                        </td>
                        <%} %>
                        <%if (chkctthnvl.Checked)
                          { %>
                        <td rowspan="2">
                            Nguyên liệu vật liệu, CCDC
                        </td>
                        <%} %>
                        <%if (chkctthcpk.Checked)
                          { %>
                        <td rowspan="2">
                            Chi phí khác
                        </td>
                        <%} %>
                        <%if (chksoquyettoan.Checked)
                          { %>
                        <td rowspan="2">
                            Số
                        </td>
                        <%} %>
                        <%if (chkngayquyettoan.Checked)
                          { %>
                        <td rowspan="2">
                            Ngày
                        </td>
                        <%} %>
                        <%if (chkgiatriquyettoan.Checked)
                          { %>
                        <td rowspan="2">
                            Giá trị
                        </td>
                        <%} %>
                    </tr>
                    <tr class="header-row">
                        <%if (chkctgktkcm.Checked)
                          { %>
                        <td>
                            TKCM
                        </td>
                        <%} %>
                        <%if (chkctgkthuechuyengia.Checked)
                          { %>
                        <td>
                            Thuê chuyên gia
                        </td>
                        <%} %>
                        <%if (chkctgkptmtn.Checked)
                          { %>
                        <td>
                            Phân tích mẫu (TN)
                        </td>
                        <%} %>
                        <%if (chkctgkptmmt.Checked)
                          { %>
                        <td>
                            Phân tích mẫu (P.MT)
                        </td>
                        <%} %>
                        <%if (chkctgkhoachat.Checked)
                          { %>
                        <td>
                            Hóa chất
                        </td>
                        <%} %>
                        <%if (chkctgkthuemuangoai.Checked)
                          { %>
                        <td>
                            Thuê mua ngoài khác
                        </td>
                        <%} %>
                        <%if (chkctthtkcm.Checked)
                          { %>
                        <td>
                            TKCM
                        </td>
                        <%} %>
                        <%if (chkctththuechuyengia.Checked)
                          { %>
                        <td>
                            Thuê chuyên gia
                        </td>
                        <%} %>
                        <%if (chkctthptmtn.Checked)
                          { %>
                        <td>
                            Phân tích mẫu (TN)
                        </td>
                        <%} %>
                        <%if (chkctthptmmt.Checked)
                          { %>
                        <td>
                            Phân tích mẫu (P.MT)
                        </td>
                        <%} %>
                        <%if (chkctthhoachat.Checked)
                          { %>
                        <td>
                            Hóa chất
                        </td>
                        <%} %>
                        <%if (chkctththuemuangoai.Checked)
                          { %>
                        <td>
                            Thuê mua ngoài khác
                        </td>
                        <%} %>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr makcp='<%#Eval("MaKCP") %>' class='<%# Eval("IsLeaf").ToString() == "-1" ? "tr-hd":""%> <%# Eval("Total_CPGK").ToString() !=Eval("Total_CPTH").ToString() ? "tr-warning":""%>'>
                    <td>
                        <%#Eval("STT") %>
                    </td>
                    <td style="width: 200px; white-space: normal;">
                        <%#Eval("Noidung")%>
                    </td>
                    <%if (chksohd.Checked)
                      { %>
                    <td>
                        <%#Eval("SoHD")%>
                    </td>
                    <%} %>
                    <%if (chkngayhd.Checked)
                      { %>
                    <td>
                        <%#Eval("NgayTaoHD")%>
                    </td>
                    <%} %>
                    <%if (chkgiatrihd.Checked)
                      { %>
                    <td>
                        <%#Eval("GiaTriHD")%>
                    </td>
                    <%} %>
                    <%if (chksokcp.Checked)
                      { %>
                    <td>
                        <%#Eval("SoKCP")%>
                    </td>
                    <%} %>
                    <%if (chkngaykcp.Checked)
                      { %>
                    <td>
                        <%#Eval("Ngay")%>
                    </td>
                    <%} %>
                    <%if (chkgiatrikcp.Checked)
                      { %>
                    <td>
                        <%#Eval("GiaTri")%>
                    </td>
                    <%} %>
                    <%if (chkphong.Checked)
                      { %>
                    <td style="width: 100px; white-space: normal;">
                        <%#Eval("Phong")%>
                    </td>
                    <%} %>
                    <%if (chktiendothuchien.Checked)
                      { %>
                    <td style="width: 100px; white-space: normal;">
                        <%#Eval("Tiendothuchien")%>
                    </td>
                    <%} %>
                    <%if (chkctgktttc.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_TTTC")%>
                    </td>
                    <%} %>
                    <%if (chkctgkquacty.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_QuaCTy")%>
                    </td>
                    <%} %>
                    <%if (chkctgktkcm.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_TKCM")%>
                    </td>
                    <%} %>
                    <%if (chkctgkthuechuyengia.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_ThueChuyenGia")%>
                    </td>
                    <%} %>
                    <%if (chkctgkptmtn.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_PTMauTN")%>
                    </td>
                    <%} %>
                    <%if (chkctgkptmmt.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_PTMauMT")%>
                    </td>
                    <%} %>
                    <%if (chkctgkhoachat.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_HoaChat")%>
                    </td>
                    <%} %>
                    <%if (chkctgkthuemuangoai.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_Thuemuangoai")%>
                    </td>
                    <%} %>
                    <%if (chkctgkluong.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_Luong")%>
                    </td>
                    <%} %>
                    <%if (chkctgknvl.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_NVL")%>
                    </td>
                    <%} %>
                    <%if (chkctgkcpk.Checked)
                      { %>
                    <td>
                        <%#Eval("CPGK_CPK")%>
                    </td>
                    <%} %>
                    <%if (chkctgktongcp.Checked)
                      { %>
                    <td>
                        <%# Eval("IsLeaf").ToString() == "0" ? QLHD.Utilities.Utilities.GetDecimalValue(Convert.ToDecimal(Eval("Total_CPGK")),true):""%>
                    </td>
                    <%} %>
                    <%if (chkctthtttc.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_TTTC")%>
                    </td>
                    <%} %>
                    <%if (chkctthchiquacty.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_QuaCty")%>
                    </td>
                    <%} %>
                    <%if (chkctgktkcm.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_TKCM")%>
                    </td>
                    <%} %>
                    <%if (chkctgkthuechuyengia.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_ThueChuyenGia")%>
                    </td>
                    <%} %>
                    <%if (chkctgkptmtn.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_PTMauTN")%>
                    </td>
                    <%} %>
                    <%if (chkctgkptmmt.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_PTMauMT")%>
                    </td>
                    <%} %>
                    <%if (chkctgkhoachat.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_HoaChat")%>
                    </td>
                    <%} %>
                    <%if (chkctgkthuemuangoai.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_Thuemuangoai")%>
                    </td>
                    <%} %>
                    <%if (chkctthluong.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_Luong")%>
                    </td>
                    <%} %>
                    <%if (chkctthnvl.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_NVL")%>
                    </td>
                    <%} %>
                    <%if (chkctthcpk.Checked)
                      { %>
                    <td>
                        <%#Eval("CPTH_CPK")%>
                    </td>
                    <%} %>
                    <%if (chkctthtongcp.Checked)
                      { %>
                    <td>
                        <%# Eval("IsLeaf").ToString() == "0" ?QLHD.Utilities.Utilities.GetDecimalValue(Convert.ToDecimal(Eval("Total_CPTH")),true):""%>
                    </td>
                    <%} %>
                    <%if (chksoquyettoan.Checked)
                      { %>
                    <td>
                        <%#Eval("QuyetToan_So")%>
                    </td>
                    <%} %>
                    <%if (chkngayquyettoan.Checked)
                      { %>
                    <td>
                        <%#Eval("QuyetToan_Ngay")%>
                    </td>
                    <%} %>
                    <%if (chkgiatriquyettoan.Checked)
                      { %>
                    <td>
                        <%#Eval("QuyetToan_Giatri")%>
                    </td>
                    <%} %>
                    <%if (chkghichu.Checked)
                      { %>
                    <td style="width: 100px; white-space: normal;">
                        <%#Eval("GhiChu")%>
                    </td>
                    <%} %>
                    <td style="width: 250px; white-space: normal;">
                        <%# Eval("IsLeaf").ToString() == "0" ? "<input type='button' value='Thêm KCP' onclick='AddKCP(" + Eval("MaHD") + "," + Eval("MaKCP") + ")'/>&nbsp;<input type='button' value='Sửa' onclick='EditKCP(" + Eval("MaKCP") + ")'/>" : ""%>
                        <%# Eval("IsLeaf").ToString() == "-1" ? "<input type='button' value='Thêm KCP' onclick='AddKCP(" + Eval("MaHD") + "," + Eval("MaKCP") + ")'/>":""%>
                        <%# Eval("IsLeaf").ToString() == "1" ? "<input type='button' value='Sửa' onclick='EditKCP(" + Eval("MaKCP") + ")'/>" : ""%>
                        <%# Eval("IsLeaf").ToString() != "-1" ? "<input type=\"button\" value=\"Xóa\" onclick=\"ItemCommand(this)\" />":""%>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <div class="pager" runat="server" id="divpager" visible="false">
            <asp:Repeater runat="server" ID="rptpage">
                <HeaderTemplate>
                    <ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <%# (Container.ItemIndex + 1).ToString() == Request.Params["page"] || (Request.Params["page"]==null && Container.ItemIndex==0) ?
                    "<span>" + (Container.ItemIndex + 1) + "</span>" : "<a href='/khoanchiphi.aspx?page=" + (Container.ItemIndex + 1) + "'>" + (Container.ItemIndex + 1) + "</a>"%>
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    </ul>
                </FooterTemplate>
            </asp:Repeater>
        </div>
    </div>
</asp:Content>
